<%-- 
    Document   : friendsearch
    Created on : Mar 25, 2012, 1:54:38 PM
    Author     : William Cheng
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" language="javascript">
                
                function searchFriends(){}
                
                function addCriteria(){}
               
        </script>
        <title>Friend Search Page</title>
        <LINK REL=StyleSheet HREF="./css/main.css" TYPE="text/css"/>
    </head>
    <body>
        <div class="filler">
            <div class="bg">
                <div class="main">
                    <div class="hdr">
                        <div class="logo">
                            <img src="./imgs/logo.png"/>
                        </div>

                        <div class="hdr_content_container">
                            <div class="acct_btns" style="margin-top : 10px;">
                                <div class="acct_btn">
                                    <a href="accountSettings.jsp">Account Settings</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="LoginServlet?action=logout">Log Out</a>
                                </div>
                            </div>

                            <div class="acct_btns" style="margin-top: 75px;">
                                <div class="acct_btn">
                                    <a href="dashboard.jsp">Home</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="calendar.jsp">Calendar</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="plans.jsp">Plans</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="data.jsp">Data</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="friends.jsp">Friends</a>
                                </div>

                            </div>
                        </div>
                    </div>
                    <!-- hdr -->
                    <div class="container">
                        <c:forEach var="friend" items="${searchedFriends}">
                            <h1>
                                <c:choose>
                                    <c:when test="${friend.privacy eq 1}">
                                        <a href="Friends?action=viewProfile&friendId=${friend.friendId}">${friend.friendName}</a>
                                    </c:when>
                                    <c:when test="${friend.privacy eq 0}">
                                        <span>${friend.friendName}</span>
                                    </c:when>
                                </c:choose>
                                
                                <c:if test="${friend.friended eq false}">
                                    <a href="Friends?action=friendRequest&yourId=${user.userID}&friendId=${friend.friendId}">Add Friend</a> 
                                </c:if>
                            </h1>
                        </c:forEach>
                    </div>
                    <!-- dashboard container -->
                </div>
                <!-- main -->
            </div>
            <!-- bg -->
        </div>
        <!-- filler -->
    </body>
</html>
